﻿#ifndef PST_THREEDCLOUDMAPSETTINGDIALOG_H
#define PST_THREEDCLOUDMAPSETTINGDIALOG_H

#include <BaseWidget/IdaDialogFrame>
#include "ui_ThreeDCloudMapSettingDialog.h"
#include <QListWidgetItem>
#include "InfomationGraph3DBasical.h"

class QSlider;
class QLabel;
class QLineEdit;

namespace BaseWidget
{
    class DoubleSpinBox;
}

namespace pst
{
    class ScalarBarSetting;
    class ThreeDCloudMapSettingData;

    class ThreeDCloudMapSettingDialog : public IdaDialogFrame
    {
        Q_OBJECT

    public:
        enum class EntryType
        {
            ScalarBar = 0,
            Geometry,
            ResultData,
            CubeAxes
        };

    public:
        ThreeDCloudMapSettingDialog(QWidget* parent = nullptr);
        ~ThreeDCloudMapSettingDialog();

        void setMainWindowId(int id);
        int getMainWindowId() const;
        void setType(EntryType type);

        bool updateSettingDataToUI(ThreeDCloudMapSettingData* data, EntryType type);

        void setScalarBarCustomRange(double min, double max);

    signals:
        void signal_updateSetting(ThreeDCloudMapSettingData* data);
        bool signal_checkResultNameIsValid(ThreeDCloudMapSettingData* data, const QString& newName) const;

    private slots:
        void on_pushButton_cancel_clicked();
        void on_pushButton_apply_clicked();
        void on_pushButton_confirm_clicked();

    private:
        void initConnections();
        void addGeometrySettingToUI();
        void addResultDataSettingToUI();
        void updateUsingDataFromUI();
        void addCubeAxesActorSettingToUI();
    private:
        Ui::ThreeDCloudMapSettingDialog ui;
        int m_mainWindowId;
        ScalarBarSetting* m_scalarBarSetting;
        int m_geometryRowCount;
        QSlider* m_geoTransparencySlider;
        QLabel* m_geoTransparencyLabel;
        int m_resultDataRowCount;
        QSlider* m_resultDataTransparencySlider;
        QLabel* m_resultDataTransparencyLabel;
        int m_cubeAxesRowCount;
        QCheckBox* m_isCubeAxesActorVisible;
        QLineEdit* m_resultNameTextLineEdit;
        //BaseWidget::DoubleSpinBox* resultScaleFactory;
        ThreeDCloudMapSettingData* m_currentData;
    };

}
#endif
